package com.aurora.oa.work.presenter;

import com.aurora.oa.listener.OnRequestCompanyStructureDataListener;
import com.aurora.oa.model.RequestHttpModel;
import com.aurora.oa.model.RequestHttpModelImpl;
import com.aurora.oa.work.bean.CompanyStructureBean;
import com.aurora.oa.work.view.CompanyStructureListActivity;
import com.aurora.oa.work.view.CompanyStructureListActivityView;

import java.util.List;

/**
 * Created by Administrator on 2017/3/31 0031.
 */
public class CompanyStructureListActivityPresenterImpl implements CompanyStructureListActivityPresenter{
    CompanyStructureListActivityView view;
    RequestHttpModel model;

    public CompanyStructureListActivityPresenterImpl(CompanyStructureListActivityView companyStructureListActivity) {
        view = companyStructureListActivity;
        model = new RequestHttpModelImpl();
    }

    @Override
    public void getStructureData() {
        model.getCompanyStructureData(new OnRequestCompanyStructureDataListener() {
            @Override
            public void onRequestCompanyStructureSuccess(List<CompanyStructureBean> companyStructureBeanList) {
                view.showContanctsData(companyStructureBeanList);
            }

            @Override
            public void onRequestCompanyStructureFail(String message) {

            }
        });
    }
}
